﻿using Microsoft.EntityFrameworkCore;
using RBAC.LuFang.Domain.Traceability;
using RBAC.LuFang.Repository.lnterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace RBAC.LuFang.Repository.lmpl
{
    public class GoodsRepository : BaseRepository<Goods>, IGoodsRepository
    {
        public GoodsRepository(EFCoreContext corecontext) : base(corecontext)
        {
        }
        //删除 删除实体
        public Task<int> Del(Goods t)
        {
            _corecontext.Remove(t);
            return _corecontext.SaveChangesAsync();
        }

        public async Task<List<Goods>> Get(Expression<Func<Goods, bool>> expre)
        {
            return await base.Get(expre);
        }

        //添加 
        public async Task<int> GetAddAsync(Goods t)
        {
            return await base.GetAddAsync(t);
        }
        //显示 不带异步
        public List<Goods> GetAll()
        {
            return base.GetAll();
        }

        //显示 带异步
        public async Task<List<Goods>> GetAllAsync()
        {
            return await base.GetAllAsync();
        }
        //反填
        public async Task<Goods> GetByidAsync(int id)
        {
            return await base.GetByidAsync(id);
        }
        //修改
        public async Task<int> GetUpd(Goods t)
        {
            return await base.GetUpd(t);
        }
    }
}
